﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Sharp.Migrations;

namespace Budgeter.Migrations
{

    class _004_Populate_EntryType : DataMigration
    {

        public override void Up()
        {
            var DATA = new[]
            {
                new { Category = "Income", IsIncome = true, Name = "Your take-home pay" },
                new { Category = "Income", IsIncome = true, Name = "Your partner's take-home pay" },
                new { Category = "Income", IsIncome = true, Name = "Bonuses / overtime" },
                new { Category = "Income", IsIncome = true, Name = "Income from savings and investments" },
                new { Category = "Income", IsIncome = true, Name = "Centrelink benefits" },
                new { Category = "Income", IsIncome = true, Name = "Family benefit payments" },
                new { Category = "Income", IsIncome = true, Name = "Child support received" },
                new { Category = "Income", IsIncome = true, Name = "Other" },

                new { Category = "Financial Commitments", IsIncome = false, Name = "Rent / mortgage" },
                new { Category = "Financial Commitments", IsIncome = false, Name = "Car loan repayments" },
                new { Category = "Financial Commitments", IsIncome = false, Name = "Other loan repayments" },
                new { Category = "Financial Commitments", IsIncome = false, Name = "Credit card interest" },
                new { Category = "Financial Commitments", IsIncome = false, Name = "Voluntary super contributions" },
                new { Category = "Financial Commitments", IsIncome = false, Name = "Savings" },
                new { Category = "Financial Commitments", IsIncome = false, Name = "Child support payments" },
                new { Category = "Financial Commitments", IsIncome = false, Name = "Donations / charity" },
                new { Category = "Financial Commitments", IsIncome = false, Name = "Pocket money" },
                new { Category = "Financial Commitments", IsIncome = false, Name = "Other" },

                new { Category = "Home", IsIncome = false, Name = "Council rates" },
                new { Category = "Home", IsIncome = false, Name = "Body corporate fees" },
                new { Category = "Home", IsIncome = false, Name = "Home and contents insurance" },
                new { Category = "Home", IsIncome = false, Name = "Home maintenance and repairs" },
                new { Category = "Home", IsIncome = false, Name = "New furniture / appliances" },
                new { Category = "Home", IsIncome = false, Name = "Other" },

                new { Category = "Utilities", IsIncome = false, Name = "Electricity" },
                new { Category = "Utilities", IsIncome = false, Name = "Gas" },
                new { Category = "Utilities", IsIncome = false, Name = "Water" },
                new { Category = "Utilities", IsIncome = false, Name = "Internet" },
                new { Category = "Utilities", IsIncome = false, Name = "Pay TV" },
                new { Category = "Utilities", IsIncome = false, Name = "Home phone" },
                new { Category = "Utilities", IsIncome = false, Name = "Mobile phone(s)" },
                new { Category = "Utilities", IsIncome = false, Name = "Other" },

                new { Category = "Education", IsIncome = false, Name = "School fees" },
                new { Category = "Education", IsIncome = false, Name = "Uni / TAFE" },
                new { Category = "Education", IsIncome = false, Name = "Childcare / pre-school" },
                new { Category = "Education", IsIncome = false, Name = "School uniforms" },
                new { Category = "Education", IsIncome = false, Name = "Sport, music, dance, etc" },
                new { Category = "Education", IsIncome = false, Name = "Excursions" },
                new { Category = "Education", IsIncome = false, Name = "Other" },
            
                new { Category = "Health", IsIncome = false, Name = "Private health insurance" },
                new { Category = "Health", IsIncome = false, Name = "Life insurance" },
                new { Category = "Health", IsIncome = false, Name = "Doctors" },
                new { Category = "Health", IsIncome = false, Name = "Dentists" },
                new { Category = "Health", IsIncome = false, Name = "Medicines / pharmacy" },
                new { Category = "Health", IsIncome = false, Name = "Eye care / glasses" },
                new { Category = "Health", IsIncome = false, Name = "Vet" },
                new { Category = "Health", IsIncome = false, Name = "Other" },

                new { Category = "Shopping", IsIncome = false, Name = "Supermarket" },
                new { Category = "Shopping", IsIncome = false, Name = "Fruit / veg" },
                new { Category = "Shopping", IsIncome = false, Name = "Baby products" },
                new { Category = "Shopping", IsIncome = false, Name = "Clothing / shoes" },
                new { Category = "Shopping", IsIncome = false, Name = "Cosmetics / toiletries" },
                new { Category = "Shopping", IsIncome = false, Name = "Hairdresser" },
                new { Category = "Shopping", IsIncome = false, Name = "Gifts and other" },
                new { Category = "Shopping", IsIncome = false, Name = "Other food and grocery" },

                new { Category = "Transport", IsIncome = false, Name = "Car insurance" },
                new { Category = "Transport", IsIncome = false, Name = "Car maintenance" },
                new { Category = "Transport", IsIncome = false, Name = "Car rego / licence" },
                new { Category = "Transport", IsIncome = false, Name = "Petrol" },
                new { Category = "Transport", IsIncome = false, Name = "Road tolls / parking" },
                new { Category = "Transport", IsIncome = false, Name = "Trains / buses / ferries" },
                new { Category = "Transport", IsIncome = false, Name = "Other" },

                new { Category = "Entertainment", IsIncome = false, Name = "Holidays" },
                new { Category = "Entertainment", IsIncome = false, Name = "Bars / clubs" },
                new { Category = "Entertainment", IsIncome = false, Name = "Other alcohol" },
                new { Category = "Entertainment", IsIncome = false, Name = "Gym / sporting membership" },
                new { Category = "Entertainment", IsIncome = false, Name = "Cigarettes" },
                new { Category = "Entertainment", IsIncome = false, Name = "Movies / music" },
                new { Category = "Entertainment", IsIncome = false, Name = "Hobbies" },
                new { Category = "Entertainment", IsIncome = false, Name = "Newspaper / magazines" },
                new { Category = "Entertainment", IsIncome = false, Name = "Celebrations" },
                new { Category = "Entertainment", IsIncome = false, Name = "Other" },

                new { Category = "Eating out", IsIncome = false, Name = "Restaurants" },
                new { Category = "Eating out", IsIncome = false, Name = "Takeaway / snacks" },
                new { Category = "Eating out", IsIncome = false, Name = "Bought lunches" },
                new { Category = "Eating out", IsIncome = false, Name = "Coffee / tea" },
                new { Category = "Eating out", IsIncome = false, Name = "Other" },
            };

            foreach (var i in DATA)
            {
                Insert.Into("EntryType")
                    .Columns("Category", "IsIncome", "Name")
                    .Values(i.Category, i.IsIncome, i.Name);
            }
        }

        public override void Down()
        {
            Delete.From("EntryType").AllRows();
        }

    }

}
